home *** CD-ROM | disk | FTP | other *** search
- ;' Based On DMA Monitor - SNG March 1999, HiSoft BASIC, WB2+
- WBStartup:NoCli:CloseEd
- WbToScreen 0
- WBenchToFront_
-
- *scr.Screen=Peek.l(Addr Screen(0)) ; get some screen info
-
- as.s="C:Audioselect"
-
- If Exists(as)
- picasso.b=True
- Else
- picasso=False
- EndIf
-
- BitMap 0,16,6,2 ;create led shapes
- Boxf 0,0,15,5,1
- Boxf 1,1,14,4,0
- Boxf 1,1,2,2,2
- GetaShape 0,0,0,16,6
- Boxf 1,1,14,4,3
- Boxf 1,1,2,2,2
- GetaShape 1,0,0,16,6
- Free BitMap 0
-
- oldstat.s="0"
-
- If ReadFile(0,"S:SNDMon.cfg") ;load config
- FileInput 0
- winx.w=Val(Edit$(8))
- winy.w=Val(Edit$(8))
- CloseFile 0
- Else
- winx=100 ; set default's if config not found
- winy=100
- EndIf
-
- If picasso
- ShapeGadget 0,2,2,$0,0,0,1
- ShapeGadget 0,19,2,$0,1,0,1
- ShapeGadget 0,36,2,$0,2,0,1
- ShapeGadget 0,53,2,$0,3,0,1
-
- Dim cmd.s(3)
- cmd(0)=as+" source=amiga set"
- cmd(1)=as+" source=av set"
- cmd(2)=as+" source=cd set"
- cmd(3)=as+" source=linein set"
- Window 0,winx,winy,72,10,$800,"",1,2,0
- Else
- Window 0,winx,winy,72,10,$800,"",1,2
- EndIf
- rp.l=RastPort(0)
-
- ;###[ CREATE OUR CUSTOM DRAGBAR! ]################################
-
- ;--- As David said, this looks bloody horrible, but it works :)
- ;
- DEFTYPE.Gadget *gad
- DEFTYPE.NewGadget ng
-
- ;--- some stuff we need :)
- ;
- *WinAddr = Peek.l(Addr Window(0))
- *VisInfo = GetVisualInfoA_(*scr,0)
- *gad = CreateContext_(&*GadList)
-
- ;--- Create drag bar gadget stuff
- ;
- ng\ng_LeftEdge = 0
- ng\ng_TopEdge = 0
- ng\ng_Width = 72
- ng\ng_Height = 10
- ng\ng_GadgetText= 0
- ng\ng_TextAttr = 0
- ng\ng_GadgetID = -1
-
- ng\ng_Flags = 0
- ng\ng_VisualInfo= *VisInfo
- ng\ng_UserData = 0
- *gad = CreateGadgetA_(#GENERIC_KIND, *gad, &ng, 0)
-
- *gad\Activation = *gad\Activation | #GACT_IMMEDIATE | #GACT_RELVERIFY
- *gad\GadgetType = #GTYP_WDRAGGING | #GTYP_BOOLGADGET
- *gad\Flags = *gad\Flags | #GFLG_GADGHNONE
-
- ;--- Add our custom dragbar to the window...
- ;
- AddGList_ *WinAddr,*GadList,-1,-1,0
- RefreshGList_ *GadList,*WinAddr,0,-1
- GT_RefreshWindow_ *WinAddr,0
-
- ;###[ END CREATE OUR CUSTOM DRAGBAR! ]############################
-
- SetAPen_ rp,2 ;draw border round window
- Move_ rp,0,9
- Draw_ rp,0,0
- Draw_ rp,71,0
- SetAPen_ rp,1
- Draw_ rp,71,9
- Draw_ rp,1,9
-
- Repeat
- stat.s=Right$(Bin$(Peek.w($dff002)),4) ; get DMA information
- If stat<>oldstat ; check for change
- chnl.b=4
- For a.b=0 To 3
- If Mid$(stat,chnl,1)="1" ; get channel status
- WBlit 1,17*a+2,2 ; if on activate led
- Else
- EraseRect_ rp,17*a+2,2,17*a+18,6 ; if off erase old led
- WBlit 0,17*a+2,2 ; and draw off led
- EndIf
- chnl-1
- Next
- oldstat.s=stat
- EndIf
- For j=1 To 10 ; pause about 1/5th second
- WaitTOF_
- Next
- If picasso
- If Event=$40
- Execute_ &cmd(GadgetHit),0,0
- oldstat="0"
- EndIf
- EndIf
- k.s=Inkey$
- Until k=Chr$(27) ; quit if esc pressed
-
- If WriteFile(0,"S:SNDMon.cfg") ; save current window position
- FileOutput 0
- NPrint WindowX
- NPrint WindowY
- CloseFile 0
- EndIf
-
- RemoveGList_ *WinAddr,*GadList,-1 ; clean up and bye bye...
- FreeGadgets_ *GadList
- FreeVisualInfo_ *VisInfo
- Free Window 0
- End
-
-